initial setup and Hello World exercise#3
Conversation
BNAndras
left a comment
There was a problem hiding this comment.
Made some notes. The main thing is to not set the track to active until we're ready to launch and have received feedback from other maintainers on the track / online editor
There was a problem hiding this comment.
This is an old set of instructions. We don't need to do it right this moment, but before launch, let's make sure to have configlet sync docs and metadata for everything.
…omplained that it exceeded the number of characters allowed
| "indent_style": "space", | ||
| "indent_size": 4 | ||
| "indent_size": 2, | ||
| "highlightjs_language": "reasonml" |
There was a problem hiding this comment.
How close is the ReasonML syntax for highlighting purposes? https://github.com/tsnobip/highlightjs-rescript might be a possibility. Exercism can load that NPM package or we can even spin up our own if we’re feeling particularly motivated.
There was a problem hiding this comment.
about 90% of the ReasonML syntax highlighting should work, but then it will fail on piping and parametric polymorphism. The package you linked looks good.
There was a problem hiding this comment.
skip utility function mimics test skipping, logging the test name to console (is that needed?). I added a skipped test here just to prove it works, and now CI is passing when unskipping.
No library change.
There was a problem hiding this comment.
That might be confusing to students. I think it’s fine to forego skips with the current testing framework. Skipped tests are preferred if reasonably possible but not obligatory.
| assertion(~message?, ~operator="stringEqual", (a, b) => a == b, a, b)`; | ||
|
|
||
| /** | ||
| * @param {string} testMethod - 'test' or 'skip' |
There was a problem hiding this comment.
My inclination is that the test generator should handle setting subsequent tests to be skipped at the end. The template here then is only concerned with setting up this specific case so it’s isolated and easier to reason about.
| @@ -0,0 +1,15 @@ | |||
| export const slug = 'hello-world'; | |||
|
|
|||
| export const assertionFunctions = `let stringEqual = (~message=?, a: string, b: string) => | |||
There was a problem hiding this comment.
Would it make sense to build and document a small library of common assertion functions that can be pulled into templates? We can still have custom functions for more complicated assertions, but then we don’t need to reinvent things like checking if a returned value is true of not.
There was a problem hiding this comment.
Yes I think this would be a good idea. I will scour through the rest of the exercises already implemented for this track in my repo and add those assertions for now, and add more as we move forward
| export const template = (testMethod, c, moduleName) => { | ||
| return `${testMethod}("${c.description}", () => { | ||
| stringEqual(~message="${c.description}", ${moduleName}.hello(), "${c.expected}") | ||
| })\n\n`; |
There was a problem hiding this comment.
the generator should add the new lines here not the template. That means there would be less of a chance for things being formatted incorrectly.
There was a problem hiding this comment.
That might be confusing to students. I think it’s fine to forego skips with the current testing framework. Skipped tests are preferred if reasonably possible but not obligatory.
There was a problem hiding this comment.
bin is usually where that goes. I think we should create a template folder at the repo root that has these extra files in the relative spots where they are expected to go in the final exercise folder. Then you can copy the template folder to the exercise folder after configlet create does its thing.
There was a problem hiding this comment.
Oh I thought this was in the hello world folder. We might as well give the students a .gitignore file in the exercise like the JS track does. At minimum, that means they won’t accidentally commit node_modules if they’re adding their solutions to a GitHub repo.
Initial commit
boilerplate code and Rescript setup copied from the work of
tesjasbubanementioned on the forum postTesting setup in accordance to previous completed work, using Rescript-Test
Hello World exercise added
npm run ciis the command from previous work which will compile ReScript files into JS and then test those. No doubt this command will need renaming.